#pragma once
#include <iostream>
#include <string>
#include <vector>
#include "cv.h"
#include "highgui.h"

class CDataPoint
{
public:
	CDataPoint(void);
	virtual ~CDataPoint(void);

	std::string GetImageFile(void){return m_image_file;};
	void SetImageFile( std::string img_file ){m_image_file=img_file;};
	std::string GetClass(void){return m_class;};
	void SetClass( std::string c ){m_class=c;};
	void SetPath( std::string path){m_path=path;};
	std::string GetPath(void){return m_path;};
	void LoadImage(void);
	void LoadImageBW(void);
	bool ImageIsBW(void);
	void FreeImage(void);
	IplImage* GetImage(void){return m_img;};
	bool HasImage(void){return(m_img==NULL);};
	std::string WriteForFile(void); 
	bool ReadForFile( std::istream is );
	CvSeq* ExtractContourStats(void);
	IplImage * GetEdgeImage(void); 
	void ExtractLineHistogram(void);
	void ExtractCircleHistogram(void); 
	CvRect GetSize(void);
	void SetID(int id){m_id=id;};
	int GetID(void){return m_id;};
	std::vector<float> MakeFeatureVector(void);
	std::string BuildFeatureVecForFile(void);
	float* GetRawFeatureVec( int &size ); 
protected:
	CvRect m_sz;
	int m_id;
	int m_sampleArea;
	int m_samplePerimeter; 
	float m_contourLength;
	float m_contourArea;
	float m_aspectRatio;
	CvMemStorage* m_memStorage;
	CvSeq* m_contour;
	CvHuMoments m_huMoments;
	CvHistogram * m_LineHist;
	CvHistogram * m_CircleHist; 
	IplImage* m_img;
	std::string m_path;
	std::string m_image_file;
	std::string m_class;
};

